<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li <if condition="$status eq 2">class="active"</if>><a href="{:U('chart',array('status'=>2))}">印刷中</a></li>
			<li <if condition="$status eq 3">class="active"</if>><a href="{:U('chart',array('status'=>3))}">已完成</a></li>
			<li <if condition="$status eq 4">class="active"</if>><a href="{:U('chart',array('status'=>4))}">已取消</a></li>
			<li <if condition="$status eq 5">class="active"</if>><a href="{:U('count',array('status'=>5))}">溯源统计</a></li>
			<li <if condition="$status eq 6">class="active"</if>><a href="{:U('count_red',array('status'=>6))}">红包统计</a></li>
			<li <if condition="$status eq 7">class="active"</if>><a href="{:U('count_detail',array('status'=>7))}">溯源统计详情</a></li>
		</ul>
		<form class="well form-search" method="GET" action="/index.php">
			<input type="hidden" name="g" value="Qrcode">
			<input type="hidden" name="m" value="AdminOrder">
			<input type="hidden" name="a" value="chart">
			<input type="hidden" name="status" value="{$status}">
			时间：
			<input type="text" name="starttime" class="js-date" value="{$formget.starttime|default=''}" style="width: 80px;" autocomplete="off" data-date-format="yyyy-mm">-
			<input type="text" class="js-date" name="endtime" value="{$formget.endtime}" style="width: 80px;" autocomplete="off" data-date-format="yyyy-mm">
			<input type="submit" class="btn btn-primary" value="搜索" />
		</form>
		<canvas id="myChart" width="400" height="150"></canvas>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__TMPL__Public/assets/js/Chart.min.js"></script>
	<script type="text/javascript">
		var ctx = document.getElementById("myChart").getContext("2d");
		var myChart = new Chart(ctx, {
		    type: 'bar',
		    data: {
		        labels:
		        [
		        <foreach name="list" item="val">
		        "{$val.date}",
		        </foreach>
		        ],
		        datasets: [{
		            label: '数量',
		            data: [
		            <foreach name="list" item="val">
			        "{$val.count}",
			        </foreach>
		            ],

		            borderWidth: 1
		        }]
		    },
		    options: {
		        scales: {
		            yAxes: [{
		                ticks: {
		                    beginAtZero:true
		                }
		            }]
		        }
		    }
		});
	</script>
</body>
</html>